package com.heitian.ssm.service.impl;

import com.heitian.ssm.dao.BathManagerEntityMapper;
import com.heitian.ssm.model.BathManagerEntity;
import com.heitian.ssm.service.BathManagerService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: mishuai
 * Date: 2018-04-25
 * Time: 12:45
 * Des:
 */
@Service("bathManagerService")
@Transactional(rollbackFor = Exception.class)
public class BathManagerServiceImpl implements BathManagerService {

    @Resource
    private BathManagerEntityMapper bathManagerEntityMapper;

    public List<BathManagerEntity> bathManagerAll() {
        return bathManagerEntityMapper.selectByPrimaryKey();
    }

    public BathManagerEntity selectByBathId(String bathId) {
        return bathManagerEntityMapper.selectByBathId(bathId);
    }

    public int updateByPrimaryKey(String bathId, String status) {
        Map<String ,String> map=new HashMap<String, String>();
        map.put("bathId",bathId);
        map.put("bathStatus",status);
        return bathManagerEntityMapper.updateByPrimaryKey(map);
    }


}
